<template>
    <view class="order-price">
        <view class="price-items">
            <view class="price-item">
                <text class="label">商品</text>
                <text class="value">￥{{ data.ProductPrice }}</text>
            </view>
            <view class="price-item">
                <text class="label">优惠</text>
                <text class="value">- ￥{{ data.PolicyDiscount }}</text>
            </view>
            <view class="price-item" v-if="data.CouponMoney && data.CouponMoney > 0">
                <text class="label">优惠券</text>
                <text class="value">- ￥{{ data.CouponMoney }}</text>
            </view>
            <view class="price-item" v-if="data.PostagePrice && data.PostagePrice > 0">
                <text class="label">运费</text>
                <text class="value">+{{ data.PostagePrice }}</text>
            </view>
        </view>
        <view class="pay-price">
            <text>{{ data.State == 12 || data.State == 0 || data.ArrearsPrice > 0 ? "需" : "已" }}付款:</text>
            <text class="pay-price-text"
                >￥{{ (data.PriceSum - data.PolicyDiscount - data.CouponMoney).toFixed(2) }}</text
            >
        </view>
    </view>
</template>

<script>
export default {
    props: {
        data: {
            type: Object,
            default: {},
        },
    },
    data() {
        return {}
    },
    mounted() {
        console.log(this.data)
    },
    methods: {},
}
</script>

<style lang="scss">
.order-price {
    .price-items {
        border-bottom: solid 1rpx $uni-bg-color-grey;
        .price-item {
            padding: $app-page-padding;
            display: flex;
            flex-direction: row;
            .label {
                display: flex;
                flex: 1;
            }
        }
    }
}
</style>
